<template>
  <div>
  <div class="c_img">
    <img src="../img/p2.png" style="opacity: 0.7;width: 70%;display: block;margin: 0 auto">
  </div>
  <div class="bg">
    <div class="header">
      <img src="../img/head.svg">
      <div class="box">
        <div class="title" style="cursor: pointer;" @click="goHome">数智化控制中心</div>
      </div>
    </div>

    <div class="dp_con">
      <div class="left">
        <div class="card" style="height: calc(100% - 0.625vw)">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>投料产出趋势</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="scgl_t2" style="height: 33.333%">
              <div class="scgl-title">近7日投料与产出</div>
              <div class="zw tb"  ref="scQs7daysChar"></div>
            </div>
            <div class="scgl_t2" style="height: 33.333%">
              <div class="scgl-title">近1年投料与产出</div>
              <div class="zw tb" ref="scQs1yearChar"></div>
            </div>

            <div class="scgl_t1" style="height: 33.333%">
              <div class="item">
                <div class="flex-0" id="main1">
                  <span class="text-chanchu">{{nowYearTLDun}}</span>
                </div>
                <p class="w-100 flex_c_c" style="color: #0099FD;font-size: 12px;font-weight: 700;">全年投料(吨)</p>
              </div>
              <div class="item">
                <div class="flex-0" id="main2">
                  <span class="text-chanchu">{{nowYearCCDun}}</span>
                </div>
                <p class="w-100 flex_c_c" style="color: #0099FD;font-size: 12px;font-weight: 700;">全年产出(吨)</p>
              </div>
              <div class="item">
                <div class="flex-0" id="main3">
                  <span class="text-chanchu">{{nowYearTLKuai}}</span>
                </div>
                <p class="w-100 flex_c_c" style="color: #0099FD;font-size: 12px;font-weight: 700;">全年投料(块)</p>
              </div>
              <div class="item">
                <div class="flex-0" id="main4">
                  <span class="text-chanchu">{{nowYearCCkuai}}</span>
                </div>
                <p class="w-100 flex_c_c" style="color: #0099FD">全年产出(片)</p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="center">
        <div class="scgl_t4">
          <div class="scgl_t3">
            <div class="item">
              <div class="text1">当日投料：</div>
              <div class="text2">{{nowDayTLDun}} <small>吨</small></div>
            </div>
            <div class="item v2">
              <div class="text1">当日产出：</div>
              <div class="text2">{{nowDayCCDun}} <small>吨</small></div>
            </div>
            <div class="item">
              <div class="text1">当日投料：</div>
              <div class="text2">{{nowDayTLKuai}} <small>块</small></div>
            </div>
            <div class="item v2">
              <div class="text1">当日产出：</div>
              <div class="text2">{{nowDayCCkuai}} <small>片</small></div>
            </div>
          </div>
        </div>

        <div class="card" style="height: calc(40% - 0.625vw);">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>产量成品率</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="zw" style="height: 100%" ref="cplChar"></div>
          </div>
        </div>
      </div>
      <div class="right">
        <div class="card" style="height: calc(60% - 0.625vw)">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>产量投产率</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body flex_c_c" style="flex-direction: column">
            <div class="zw w-100" style="height: 50%;margin: 8px 0" ref="tcl1Char"></div>
            <div class="zw w-100" style="height: 50%;margin: 8px 0" ref="tcl2Char"></div>
          </div>
        </div>
        <div class="card" style="height: calc(40% - 0.625vw)">
          <div class="title">
            <img class="icon1" src="../img/icon1.svg">
            <span>投产重量</span>
            <img class="icon2" src="../img/icon2.svg">
          </div>
          <div class="body">
            <div class="zw" style="height: 100%" ref="tczlChar"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="footer">
      <img src="../img/footer.svg">
    </div>
  </div>
  </div>
</template>

<script>
import {initTheme} from '@/components/SettingDrawer/settingConfig'
import defaultSettings from '@/config/defaultSettings'
import {SysMixin} from '@/mixins/SysMixin'


import * as echarts from 'echarts'
import 'echarts-liquidfill'
import Big from 'big.js'
import moment from 'moment';
import constant from '@/views/kzzx/utils/constant'
import {
  iss_event_stat_window,
  mes_dongqing_summary,
  iss_event_stat_type,
  ems_electric_summary,
  ems_electric_history,
  dpm_oee, mes_dongqing_history
} from '@/views/kzzx/utils/api'
import {
  getNowDaySTTime,
  getNowMonthSTTime,
  getNowYearSTTime,
  getMonthStartEnd,
  getMonthAgoToNowSTTime,
  getDecimalPlaces,
  getDaysAgo,
  getMonthAgo,
  formatDateTime, formatDate

} from '@/views/kzzx/utils/util'
import big from 'big.js'


export default {
  name: 'sc',
  components: {},
  mixins:[SysMixin],
  beforeCreate () {

  },

  beforeDestroy () {
    if(this.timmer){
      console.log("清除定时器")
      clearTimeout(this.timmer)
    }
  },

  data () {
    return {
      visible:false,
      //近7日投料与产出 图表
      scQs7daysChar: null,

      //近1年投料与产出 图表
      scQs1yearChar: null,

      //成品率
      cplChar: null,

      //投产率上
      tcl1Char: null,

      //投产率下
      tcl2Char: null,

      //投产重量
      tczlChar: null,


      //全年投料吨
      nowYearTLDun:0,
      //全年产出吨
      nowYearCCDun:0,
      //全年投料块
      nowYearTLKuai:0,
      //全年产出片
      nowYearCCkuai:0,

      //当日投料吨
      nowDayTLDun:0,
      //当日产出吨
      nowDayCCDun:0,
      //当日投料块
      nowDayTLKuai:0,
      //当日产出片
      nowDayCCkuai:0,

      //定时器
      timmer:null,

      //间隔
      interval:1000*60*10

    }
  },
  // 监听属性
  computed: {

  },
  created () {},
  mounted () {
    document.title = "生产概况"
    let that = this
    this.initTheme()
    that.$nextTick(() => {
      that.initChar()
      that.query()
    })
  },
  destroy () {

  },
  methods: {
    showModal() {
      this.visible = true;
    },
    initTheme(){
      let theme = localStorage.getItem(defaultSettings.localStorageThemeKey)
      initTheme(theme || defaultSettings.primaryTheme)
    },
    handleOk(e) {

      this.visible = false;

    },
    handleCancel(e) {
      this.visible = false;
    },

    initChar () {
      this.scQs7daysChar = echarts.init(this.$refs.scQs7daysChar)
      this.scQs1yearChar = echarts.init(this.$refs.scQs1yearChar)
      this.cplChar = echarts.init(this.$refs.cplChar)
      this.tcl1Char = echarts.init(this.$refs.tcl1Char)
      this.tcl2Char = echarts.init(this.$refs.tcl2Char)
      this.tczlChar = echarts.init(this.$refs.tczlChar)
    },
    query(){
      //获取全年生产数据
      this.queryNowYearSC()
      //获取当日生产数据
      this.queryNowDaySC()

      //查询近7日投料与产出
      this.queryScQs7daysData()

      //查询近一年投料与产出
      this.queryScQs1yearData()

      //查询近7日投产率 吨
      this.queryTclDunData()

      //查询近7日投产率 块
      this.queryTclKuaiData()


      //查询近7日投产重量
      this.queryTczlData()

      this.queryCplData()


      if(this.timmer){
        clearTimeout(this.timmer)
      }
      this.timmer = setTimeout(() => {
        this.query()
      }, this.interval)

    },
    /**
     * 获取全年投料
     */
    queryNowYearSC(){
      let year = getNowYearSTTime()
      mes_dongqing_summary(year.start,year.end).then(res=>{
        if(constant.successCode===res.code){
          console.log("接口：/api/mes/dongqing/summary","方法：mes_dongqing_summary",res)
          this.nowYearTLDun = res.data.weight_input
          this.nowYearCCDun = res.data.weight_output
          this.nowYearTLKuai = res.data.blocks
          this.nowYearCCkuai = res.data.pieces

          if(this.nowYearTLDun){
            this.nowYearTLDun = Big(this.nowYearTLDun).toFixed(0)
          }
          if(this.nowYearCCDun){
            this.nowYearCCDun = Big(this.nowYearCCDun).toFixed(0)
          }
          if(this.nowYearTLKuai){
            this.nowYearTLKuai = Big(this.nowYearTLKuai).toFixed(0)
          }
          if(this.nowYearCCkuai){
            this.nowYearCCkuai = Big(this.nowYearCCkuai).toFixed(0)
          }

        }
      })
    },
    /**
     * 获取全年投料
     */
    queryNowDaySC(){

      //获取当前日期的开始和截止时间
      let day = getNowDaySTTime()
      mes_dongqing_summary(day.start,day.end).then(res=>{
        console.log("接口：/api/mes/dongqing/summary","方法：mes_dongqing_summary",res)
        if(constant.successCode===res.code){
          this.nowDayTLDun = res.data.weight_input
          this.nowDayCCDun = res.data.weight_output
          this.nowDayTLKuai = res.data.blocks
          this.nowDayCCkuai = res.data.pieces
          if(this.nowDayTLDun){
            this.nowDayTLDun = Big(this.nowDayTLDun).toFixed(0)
          }
          if(this.nowDayCCDun){
            this.nowDayCCDun = Big(this.nowDayCCDun).toFixed(0)
          }
          if(this.nowDayTLKuai){
            this.nowDayTLKuai = Big(this.nowDayTLKuai).toFixed(0)
          }
          if(this.nowDayCCkuai){
            this.nowDayCCkuai = Big(this.nowDayCCkuai).toFixed(0)
          }
        }
      })
    },

    /**
     * 查询近7日投料与产出
     */
    queryScQs7daysData(){
      let day = getDaysAgo(6)
      mes_dongqing_history(day+" 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_d).then(res=>{

        if(constant.successCode===res.code){
          console.log("接口：/api/mes/dongqing/history","方法：mes_dongqing_history",res)
          let source = res.data.source
          let xAxisData = []
          let clDun=[]//产量吨
          let tlDun=[]//投料吨
          let tlKuai=[]//投料块
          let lpKuai =[]//落片块
          for(const item of source){
            let date = item[0]
            xAxisData.push(date.substring(date.indexOf("-")+1))
            clDun.push(item[1])
            tlDun.push(item[3])
            tlKuai.push(item[4])
            lpKuai.push(item[5])
          }
          this.setScQs7daysChar(xAxisData,clDun,tlDun,tlKuai,lpKuai)
        }
      })
    },

    /**
     * 近1年投料与产出
     */
    queryScQs1yearData(){
      let month = getMonthAgo(11)

      mes_dongqing_history(month+"-01 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_mo).then(res=>{
        if(constant.successCode===res.code){
          console.log("接口：/api/mes/dongqing/history","方法：mes_dongqing_history",res)
          let source = res.data.source
          let xAxisData = []
          let clDun=[]//产量吨
          let tlDun=[]//投料吨
          let tlKuai=[]//投料块
          let lpKuai =[]//落片块
          for(const item of source){
            xAxisData.push(item[0])
            clDun.push(item[1])
            tlDun.push(item[3])
            tlKuai.push(item[4])
            lpKuai.push(item[5])
          }
          this.setScQs1yearChar(xAxisData,clDun,tlDun,tlKuai,lpKuai)
        }
      })
    },

    /**
     * 查询近7日投产重量
     */
    queryTczlData(){
      let day = getDaysAgo(6)
      mes_dongqing_history(day+" 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_d).then(res=>{
        console.log("接口：/api/mes/dongqing/history","方法：mes_dongqing_history",res)
        if(constant.successCode===res.code){
          let source = res.data.source
          let yAxisData = []
          let clDun=[]//产量吨
          let tlDun=[]//投料吨
          for(const item of source){
            let date = item[0]
            yAxisData.push(date.substring(date.indexOf("-")+1))
            clDun.push(item[1])
            tlDun.push(item[3])
          }
          this.setTczlChar(yAxisData,clDun,tlDun)
        }
      })
    },

    /**
     * 查询投产率吨
     */
    queryTclDunData(){
      let day = getDaysAgo(6)
      mes_dongqing_history(day+" 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_d).then(res=>{
        console.log("接口：/api/mes/dongqing/history","方法：mes_dongqing_history",res)
        if(constant.successCode===res.code){
          let source = res.data.source
          let xAxisData = []
          let clDun=[]//产量吨
          let tlDun=[]//投料吨
          let tcl=[]//投产率
          for(const item of source){
            let date = item[0]
            xAxisData.push(date.substring(date.indexOf("-")+1))
            clDun.push(item[1])
            tlDun.push(item[3])
            let l = Big(item[1]).div(Big(item[3])).toFixed(2)
            tcl.push(Big(l).times(Big(100)).toString())
          }
          this.setTcl1Char(xAxisData,clDun,tlDun,tcl)
        }
      })
    },

    /**
     * 查询投产率块
     */
    queryTclKuaiData(){
      let day = getDaysAgo(6)
      mes_dongqing_history(day+" 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_d).then(res=>{
        if(constant.successCode===res.code){
          let source = res.data.source
          let xAxisData = []
          let clKuai=[]//产量块
          let tlKuai=[]//投料块
          let tcl=[]//投产率
          for(const item of source){
            let date = item[0]
            xAxisData.push(date.substring(date.indexOf("-")+1))
            clKuai.push(item[5])
            tlKuai.push(item[4])
            let l = Big(item[5]).div(Big(item[4])).toFixed(2)
            tcl.push(Big(l).times(Big(100)).toString())
          }
          this.setTcl2Char(xAxisData,clKuai,tlKuai,tcl)
        }
      })
    },

    /**
     * 成品率
     */
    queryCplData(){
      let day = getDaysAgo(11)
      mes_dongqing_history(day+" 00:00:00",formatDateTime(new Date()),constant.win_group,constant.winUnit_mo).then(res=> {
        console.log("接口：/api/mes/dongqing/history","方法：queryCplData",res)
        if(constant.successCode===res.code){
          let source = res.data.source
          let yAxisData = []
          let cc=[]//产出
          let cpl=[]//成品率
          for(const item of source){
            let date = item[0]
            yAxisData.push(item[0])
            cc.push(item[5])
            //产出重量/投料重量
            cpl.push(Big(item[1]).div(Big(item[3])).times(Big(100)).toFixed(2).toString())
          }
          this.setCplChar(yAxisData,cc,cpl)
        }
      })
    },

    //近7日投料与产出
    setScQs7daysChar (xAxisData,clDun,tlDun,tlKuai,lpKuai) {
      let option = {
        grid:{
          bottom:'18px',
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['产量(吨)', '投料(吨)', '投料(块)', '落片量(片)'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        series: [
          {
            name: '产量(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#376DF7'
            },
            data: clDun
          },
          {
            name: '投料(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#53B997'
            },
            data: tlDun
          },
          {
            name: '投料(块)',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#624DA5'
            },
            data: tlKuai
          },
          {
            name: '落片量(片)',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value + ' 片'
              }
            },
            itemStyle:{
              color:'#F8C541'
            },
            data: lpKuai
          }
        ]
      }
      this.scQs7daysChar.setOption(option)
    },

    /**
     * 近1年投料与产出
     */
    setScQs1yearChar (xAxisData,clDun,tlDun,tlKuai,lpKuai) {
      let option = {
        grid:{
          bottom:'12%',
          top:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['产量(吨)', '投料(吨)', '投料(块)', '落片量(片)'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        dataZoom: [{
          height:10,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        },],
        series: [
          {
            name: '产量(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#376DF7'
            },
            data:clDun
          },
          {
            name: '投料(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#53B997'
            },
            data:tlDun
          },
          {
            name: '投料(块)',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            itemStyle:{
              color:'#624DA5'
            },
            data: tlKuai
          },
          {
            name: '落片量(片)',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value + ' 片'
              }
            },
            itemStyle:{
              color:'#F8C541'
            },
            data: lpKuai
          }
        ]
      }
      this.scQs1yearChar.setOption(option)
    },

    /**
     *成品率
     */
    setCplChar (yAxisData,cc,cpl) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['产出(片)', '合格(片)', '成品率'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: yAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        dataZoom: [{
          height:10,
          type: 'slider', // 内部滚动条
          start: 0,       // 初始滚动位置
          end: 100,         // 初始显示的部分（0% 到 50%）
          show:true,        // 初始显示的部分（0% 到 50%）
          bottom:0
        },],
        series: [
          {
            name: '产出(片)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: cc,
            itemStyle: {
              color: '#376DF7'
            }
          },

          {
            name: '成品率',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: cpl,
            itemStyle: {
              color: '#6C50AA'
            }
          }
        ]
      }
      this.cplChar.setOption(option)
    },

    /**
     * 投产率上
     */
    setTcl1Char (xAxisData,clDun,tlDun,tcl) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['投料(吨)', '产出(吨)', '投产率'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        series: [
          {
            name: '投料(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: tlDun,
            itemStyle: {
              color: '#752AEE'
            }
          },
          {
            name: '产出(吨)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: clDun,
            itemStyle: {
              color: '#1884FF'
            }
          },

          {
            name: '投产率%',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value+ '%'
              }
            },
            data: tcl,
            itemStyle: {
              color: '#EB941E'
            }
          }
        ]
      }
      this.tcl1Char.setOption(option)
    },

    /**
     * 投产率下
     */
    setTcl2Char (xAxisData,clKuai,tlKuai,tcl) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow',
            crossStyle: {
              color: '#999'
            }
          }
        },
        legend: {
          data: ['投料(块)', '产出(块)', '投产率'],
          textStyle: { color: '#ffffff' }
        },
        xAxis: [
          {
            type: 'category',
            data: xAxisData,
            axisPointer: { type: 'shadow' },
            axisLine: { lineStyle: { color: '#ffffff' } }
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: { formatter: '{value}' },
            axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
            splitLine: {
              lineStyle: {
                color: '#318BAB', // 设置线的颜色为蓝色
                width: 2,         // 设置线的宽度
                type: 'dashed'     // 设置线的类型为实线
              }
            }
          },
          {
            axisLine: {
              show: false, lineStyle: { color: '#ffffff' }
            },
            splitLine: {
              show: false
            }
          }
        ],
        series: [
          {
            name: '投料(块)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: tlKuai,
            itemStyle: {
              color: '#752AEE'
            }
          },
          {
            name: '产出(块)',
            type: 'bar',
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data: clKuai,
            itemStyle: {
              color: '#1884FF'
            }
          },

          {
            name: '投产率%',
            type: 'line',
            yAxisIndex: 1,
            tooltip: {
              valueFormatter: function (value) {
                return value
              }
            },
            data:tcl,
            itemStyle: {
              color: '#EB941E'
            }
          }
        ]
      }
      this.tcl2Char.setOption(option)
    },

    /**
     * 投产重量
     */
    setTczlChar (yAxisData,clDun,tlDun) {
      let option = {
        grid:{
          top:'12%',
          bottom:'12%',
          left:'12%'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        legend: {
          textStyle: { color: '#ffffff' }
        },

        xAxis: {
          type: 'value',
          axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } },
          splitLine: {
            lineStyle: {
              color: '#318BAB', // 设置线的颜色为蓝色
              width: 2,         // 设置线的宽度
              type: 'dashed'     // 设置线的类型为实线
            }
          }
        },
        yAxis: {
          type: 'category',
          data: yAxisData,
          axisLine: { lineStyle: { color: '#ffffff', width: 1, type: 'dashed' } }
        },
        series: [
          {
            name: '投料(吨)',
            type: 'bar',
            label: {
              show: true
            },
            emphasis: {
              focus: 'series'
            },
            data: tlDun,
            itemStyle: {
              color: '#376DF7'
            }
          },
          {
            name: '产出(吨)',
            type: 'bar',
            label: {
              show: true
            },
            emphasis: {
              focus: 'series'
            },
            data: clDun,
            itemStyle: {
              color: '#3CFEFF'
            }
          }
        ]
      }
      this.tczlChar.setOption(option)
    },

    goHome(){
      this.$router.push('/home')
      // window.location.href = constant.homeUrl
    }

  }

}
</script>

<style lang="less" scoped>

body {
  font-family: 'myriad-pro', 'Arial' !important;
  margin: 0;
  padding: 0;
}

.w-100 {
  width: 100%;
}

.flex {
  display: flex;
}

.flex-0 {
  flex: 0 0 auto;
  background: url(../img/chanchu.png) 100% no-repeat;
  background-size: 100% 100%;
  height: 110px;
  width: 109px;
  position: relative;
}

.flex_c_c {
  display: flex;
  align-items: center;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  margin: auto;
  max-width: 68.750vw;
}

ul, li, p {
  margin: 0;
  padding: 0;
  list-style: none;
}


.header {
  position: relative;
  box-sizing: content-box;
  height: 6.875vw;

  > img {
    width: 100%;
  }

  .box {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 99;

    .title {
      font-size: 2.188vw;
      font-weight: bold;
      text-align: center;
      margin-top: 2.240vw;
      text-shadow: 0 0.208vw 0.208vw rgba(0, 0, 0, 0.25);
      background: linear-gradient(180deg, #FFFFFF 0%, #83C3EF 83%, #0184DE 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

  }
}


.bg {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-size: 0.729vw;
  line-height: 1;
  background-image: url('../img/bg.png');
  background-repeat: no-repeat;
  background-position: top;
  background-size: cover;
  color: #fff;

}


.dp_con {
  position: relative;
  //background-image: url("../img/line2.svg");
  background-size: 97.6%;
  height: calc(100vh - 6.354vw);
  background-repeat: no-repeat;
  background-position: center bottom;
  padding: 0 0.833vw;
  display: flex;
  margin-top: -2.083vw;


  .left {
    width: 26.302vw;
    flex: 0 0 auto;
  }

  .right {
    width: 26.302vw;
    flex: 0 0 auto;
  }

  .center {
    width: 100%;
    padding: 0 0.833vw;
  }
}

.card {
  margin-bottom: 0.625vw;
  text-align: left;
  background: rgba(10, 63, 152, 0.2);
  position: relative;
  padding: 0.417vw;
  box-sizing: border-box;

  .title {
    display: flex;
    align-items: center;
    background-size: 100%;
    background-position: bottom;
    padding-bottom: 0.521vw;
    font-size: 0.938vw;
    font-weight: bold;
    margin-bottom: 0.313vw;
    background-repeat: no-repeat;
    text-shadow: 0 0 0.521vw #00b6ff;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      width: 3.385vw;
      height: 0.156vw;
      background: #0086FF;
    }

    &::after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 3.646vw;
      right: 2.604vw;
      height: 0.156vw;
      background: #083566;
    }

    .icon1 {
      margin-right: 0.625vw;
      width: 0.781vw;
    }

    .icon2 {
      position: absolute;
      width: 2.500vw;
      bottom: 0;
      right: 0;
    }
  }

  .body {
    position: relative;
    padding: 0.417vw;
    box-sizing: border-box;
    height: calc(100% - 2.396vw);

    > .img {
      position: absolute;
      width: 0.521vw;

      &.t1 {
        left: 0;
        top: 0;
      }

      &.t2 {
        right: 0;
        top: 0;
        transform: rotate(90deg);
      }

      &.t3 {
        left: 0;
        bottom: 0;
        transform: rotate(270deg);
      }

      &.t4 {
        right: 0;
        bottom: 0;
        transform: rotate(180deg);
      }
    }

  }
}

.height_50 {
  height: calc(50% - 0.625vw)
}

.height_3 {
  height: calc(33.33% - 0.625vw)
}

.height_6 {
  height: calc(66.66% - 0.625vw)
}

/* 整个滚动条 */
::-webkit-scrollbar {
  width: 0.313vw; /* 滚动条宽度 */
}

/* 滚动条轨道 */
::-webkit-scrollbar-track {
  background: rgba(241, 241, 241, 0); /* 轨道背景色 */
  border-radius: 0.313vw;
}

/* 滚动条滑块 */
::-webkit-scrollbar-thumb {
  background: #9dbfd2; /* 滑块背景色 */
  border-radius: 0.313vw;
}

/* 滚动条滑块悬停状态 */
::-webkit-scrollbar-thumb:hover {
  background: #555; /* 滑块悬停时的背景色 */
}


.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  img {
    display: block;
    margin: auto;
    width: 70.729vw;
  }
}

.sckg {
  display: flex;
  justify-content: space-between;

  .item {
    width: 4.688vw;
    text-align: center;

    img {
      width: 100%;
      display: block;
    }

    .text1 {
      position: relative;
      top: -2.604vw;
      font-weight: bold;
      font-size: 1.458vw;
      color: #FFFFFF;
      line-height: 1;
      background: linear-gradient(180deg, #FFFFFF 0%, #55D0FF 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      margin-top: -0.781vw;
    }

    .text2 {
      font-size: 0.625vw;
    }
  }
}

.sckg_tb {
  height: calc(100% - 6.458vw);
  margin-top: 0.625vw;
}

.sbxj {
  display: flex;
  justify-content: space-between;

  .item {
    flex: 1;
    text-align: center;

    img {
      width: 3.646vw;
    }

    .text1 {
      font-size: 0.573vw;
      margin: 0.521vw 0;
    }

    .text2 {
      font-size: 1.042vw;

      small {
        font-size: 0.677vw;
      }
    }
  }
}

.sbxj_tb {
  height: calc(100% - 7.813vw);
  margin-top: 0.625vw;
}


.znaf_tb {
  display: flex;
  height: 100%;
}

.ydtj {
  display: flex;

  .icon1 {
    width: 5.729vw;
    margin: 1.042vw 1.302vw 0 0.625vw;
  }

  .item {
    position: relative;
    font-size: 0.729vw;
    margin-bottom: 0.625vw;

    img {
      width: 100%;
      display: block;
    }

    .text1 {
    }

    .text2 {
      font-size: 1.250vw;
      font-weight: bold;
      position: relative;
      top: -0.052vw;
    }

    .text3 {
      margin-left: 0.625vw;
    }

    .info {
      position: absolute;
      left: 1.354vw;
      right: 0.729vw;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
    }
  }
}

.ydtj_tb {
  height: calc(100% - 8.125vw);
}

.sbjx {
  display: flex;
  justify-content: space-around;

  .item {
    text-align: center;
    flex: 1;

    div {
      height: 5.208vw;
    }

    p {
      margin-top: 0.625vw;
    }
    &.v2{
      div{
        height: 6.771vw
      }
    }
  }
}


.sbjx_tb {
  height: calc(100% - 7.292vw);
  margin-top: 0.625vw;

}

.zw {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
}

.sblyl {
  height: 100%;
}


.sbxj_tb {
  height: calc(100% - 8.594vw);
  margin-top: 0.625vw;
}


.xnzb_c {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-direction: column;

  .r1 {
    width: 21.354vw;

    .item {
      margin: 2.083vw 0;
    }

    .line {
      height: 0.156vw;
      background: rgba(255, 255, 255, 0.28);
      display: flex;
      justify-content: space-between;
      align-items: center;

      &::before, &::after {
        content: "";
        width: 1.146vw;
        height: 0.156vw;
        background: #FED9A6;
        box-shadow: 0 0 0.313vw 0 #FED9A6;
      }
    }

    .box {
      margin: 0.417vw 0;
      background: #003E59;
      border: 0.052vw solid #00F9FF;
      height: 4.167vw;
      display: flex;
      align-items: center;
      padding: 0 1.250vw 0 0;
      box-sizing: border-box;

      img {
        width: 4.167vw;
        height: 4.167vw;
        margin-right: 0.625vw;
      }

      .text1 {
        font-size: 0.885vw;
      }

      .text2 {
        font-size: 0.729vw;
        margin-top: 0.625vw;
      }

      .text3 {
        font-size: 1.667vw;
        color: #12E4F5;
        font-weight: bold;
      }

      &.v2 {
        background: #0B2248;
        border: 0.052vw solid #2F6EDD;

        .text3 {
          color: #2F6EDD;
        }
      }
    }
  }

  .r2 {
    position: relative;

    .bg2 {
      width: 26.823vw;
      display: block;
      padding: 2.083vw 2.083vw 0 2.083vw;
      box-sizing: border-box;
    }

    .item {
      text-align: center;
      position: absolute;
      z-index: 1;
      top: 0;
      left: 0;

      .text1 {
        width: 3.333vw;
        height: 3.333vw;
        text-align: center;
        line-height: 3.333vw;
        background-image: url("../img/icon7.svg");
        border-radius: 100%;
        margin: auto;
        font-size: 1.042vw;
      }

      .text2 {
        margin-top: 0.417vw;
      }

      &:nth-child(1) {
        top: 35%;
      }

      &:nth-child(2) {
        top: 0;
        left: 13%;
      }

      &:nth-child(3) {
        top: 0;
        left: 75%;
      }

      &:nth-child(4) {
        top: 38%;
        left: 87%;
      }
    }
  }
}


.scgl-title {
  text-align: center;
  margin-bottom: 0.625vw;
}

.scgl_t1 {
  display: flex;
  flex-wrap: wrap;

  .item {
    width: 50%;
    height: 50%;
    padding: 0.625vw 0;
    box-sizing: border-box;
    display: flex;

    .flex-0 {
      height: 100%;
      width: 50%;
    }

    .flex_c_c {
      justify-content: flex-start;
      padding-left: 0.625vw;
    }
  }
}

.scgl_t2 {
  .tb {
    height: calc(100% - 2.292vw);
  }
}


.c_img {
  position: absolute;
  width: 50%;
  left: 25%;
  top: 10%;

  img {
    width: 100%;
  }
}


.scgl_t3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  .item {
    width: 16.667vw;
    height: 4.635vw;
    background-image: url("../img/p5.svg");
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.042vw;

    .text1 {
      margin-right: 1.042vw;
    }

    .text2 {
      font-size: 2.188vw;
      font-weight: bold;
      color: #0BF9FE;

      small {
        font-size: 0.833vw;
        font-weight: 500;
        color: #fff;
      }
    }

    &.v2 {
      background-image: url("../img/p6.svg");

      .text2 {
        color: #07E96C;
      }
    }
  }
}


.sjtj {
  display: flex;
  justify-content: space-around;
  position: relative;
  z-index: 1;

  .item {
    width: 7.083vw;
    text-align: center;

    .text1 {
      font-size: 1.406vw;
      color: #FFFFFF;
      letter-spacing: 0.052vw;
      font-style: normal;
      text-transform: none;
    }

    .text2 {
      color: rgba(255, 255, 255, 0.7);
      width: 7.083vw;
      line-height: 1.458vw;
      background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, #4E3B01 49%, rgba(0, 0, 0, 0) 100%);
      position: relative;
      margin-top: 0.625vw;

      &::after, &::before {
        content: "";
        width: 100%;
        height: 0.052vw;
        background: linear-gradient(90deg, rgba(87, 69, 0, 0) 0%, #FFCB00 49%, rgba(126, 101, 0, 0) 100%);
        position: absolute;
        top: 0;
        left: 0;
      }

      &::before {
        bottom: 0;
        top: auto;
      }
    }

    img {
      width: 5.417vw;
      margin-top: -1.042vw;
    }

    &.v2 {
      margin-top: 3.646vw;

      img {
        width: 6.458vw;
      }

      .text2 {
        background: linear-gradient(270deg, rgba(0, 0, 0, 0.02) 0%, #01434E 49%, rgba(0, 0, 0, 0) 100%);

        &::after, &::before {
          background: linear-gradient(90deg, rgba(0, 46, 87, 0) 0%, #00C2FF 49%, rgba(0, 104, 126, 0) 100%);
        }
      }
    }
  }
}

.sjtj-bg {
  width: 100%;
  margin-top: -100%;
  position: relative;
  top: -3.490vw;
}


.zhaf_t1 {
  padding: 2.083vw 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;

  .r1 {
    height: 50%;
    position: relative;

    img {
      height: 100%;
      display: block;
    }

    .box {
      position: absolute;
      z-index: 2;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      padding: 1.250vw;

      img {
        width: 100%;
        height: 100%;

      }
    }
  }

  .r2 {
    height: 50%;
    display: flex;
    align-items: flex-end;
    justify-content: center;

    img {
      height: 90%;
      display: block;
    }
  }
}

.zhaf_t2 {
  overflow: auto;
  height: 100%;

  ul {

    li {
      display: flex;
      margin-bottom: 0.625vw;
      position: relative;

      &::before {
        content: "";
        position: absolute;
        left: 0.781vw;
        height: 100%;
        background: #ff0000;
        top: 1.042vw;
        width: 0.052vw;
      }

      &:nth-last-child(1) {
        &::before {
          content: "";
          position: absolute;
          left: 0.781vw;
          height: 0;
          background: #ff0000;
          top: 1.042vw;
          width: 0.052vw;
        }
      }

      .icon1 {
        width: 1.510vw;
        margin-right: 0.625vw;
      }

      .info {
        position: relative;

        .box {
          position: absolute;
          z-index: 2;
          left: 0;
          right: 0;
          top: 0;
          bottom: 0;
          padding: 1.250vw;
          display: flex;
          flex-direction: column;
          justify-content: space-around;

          .btn_box {
            position: absolute;
            right: 1.250vw;
            bottom: 1.250vw;

            button {
              width: 5.521vw;
              height: 1.667vw;
              background: #2F51FF;
              border-radius: 0.208vw 0.208vw 0.208vw 0.208vw;
              display: flex;
              align-items: center;
              justify-content: center;
              border: none;
              color: #fff;
              margin-top: 0.625vw;
              cursor: pointer;

              &:hover {
                background: #4a68ff;
              }
            }
          }
        }
      }
    }
  }
}

.zhaf_t3{
  width: 29.688vw !important;
}

.dp_con {
  position: relative;
  z-index: 9;

  .left.v2 {
    width: 55%;
    padding-right: 0.417vw;
  }

  .right.v2 {
    width: 45%;
    padding-left: 0.417vw;
  }
}

.ydtj_t1 {
  height: 100%;
  display: block;
  width: 100%;
  object-fit: cover;
  padding-bottom: 0.625vw;
  box-sizing: border-box;
}

.ydtj_t2{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .item{
    background-image: url("../img/bg6.svg");
    width: 13.333vw;
    height: 5.156vw;
    background-size: cover;
    text-align: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;

    p{
      padding-left: 4.167vw;
      width: 100%;
      box-sizing: border-box;
    }
    .text1{
      font-weight: bold;
      font-size: 1.354vw;
      letter-spacing: 0.104vw;
      background: linear-gradient(180deg, #FFFFFF 0%, #20F14E 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      margin-bottom: 0.417vw;
    }
    &:nth-child(1),&:nth-child(2),&:nth-child(3){
      margin-bottom: 1.042vw;
      background-image: url("../img/bg5.svg");
      .text1{
        background: linear-gradient(180deg, #FFFFFF 0%, #0BF9FE 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
      }
    }
  }
}

.p-8{
  margin: 0 -0.417vw;
  .w-100{
    padding: 0 0.417vw;
    box-sizing: border-box;
  }
}

.scgl_t4{
  height: calc(60% - 0.625vw);margin-bottom: 0.625vw;padding-top: 2.604vw;box-sizing: border-box
}
.zhaf_h{
  height: calc(50% - 8.646vw - 0.625vw)
}
.ydtj_h{
  height: calc(50% - 8.333vw)
}
.text-chanchu{
  position: absolute;
  text-align: center;
  left: 0;
  width: 100%;
  top: 40%;
  font-size: 20px;
  font-weight: bold;
}

</style>



